package com.springboot.springbootredis.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: TongRui乀
 * @Date: 2020-08-19 19:50
 * @description：
 */
@RestController
public class RedisController {

    @Autowired
    private RedisTemplate redisTemplate;


    @GetMapping("send")
    public String sendMessage(String message){

        redisTemplate.convertAndSend("test-redis", message);

        return "SUCCESS";
    }
}
